using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Text;

internal class ah
{
	public class a
	{
		private byte[] m_a;

		private byte[] m_b;

		[SpecialName]
		public byte[] b()
		{
			return this.m_a;
		}

		[SpecialName]
		public void b(byte[] A_0)
		{
			this.m_a = A_0;
		}

		[SpecialName]
		public byte[] a()
		{
			return this.m_b;
		}

		[SpecialName]
		public void a(byte[] A_0)
		{
			this.m_b = A_0;
		}
	}

	private DESCryptoServiceProvider m_a = new DESCryptoServiceProvider();

	private w m_b;

	private w m_c;

	[SpecialName]
	public a c()
	{
		a a2 = new a();
		if (a() != null)
		{
			a2.b(a().b(this.m_a.Key));
			a2.a(a().b(this.m_a.IV));
		}
		else
		{
			a2.b(this.m_a.Key);
			a2.a(this.m_a.IV);
		}
		return a2;
	}

	[SpecialName]
	public void a(a A_0)
	{
		if (b() != null)
		{
			this.m_a.Key = b().c(A_0.b());
			this.m_a.IV = b().c(A_0.a());
		}
		else
		{
			this.m_a.Key = A_0.b();
			this.m_a.IV = A_0.a();
		}
	}

	[SpecialName]
	public w b()
	{
		return this.m_b;
	}

	[SpecialName]
	public void b(w A_0)
	{
		this.m_b = A_0;
	}

	[SpecialName]
	public w a()
	{
		return this.m_c;
	}

	[SpecialName]
	public void a(w A_0)
	{
		this.m_c = A_0;
	}

	public string a(string A_0)
	{
		return Convert.ToBase64String(a(Encoding.UTF8.GetBytes(A_0)));
	}

	public byte[] a(byte[] A_0)
	{
		MemoryStream memoryStream = new MemoryStream();
		CryptoStream cryptoStream = new CryptoStream(memoryStream, this.m_a.CreateEncryptor(), CryptoStreamMode.Write);
		cryptoStream.Write(A_0, 0, A_0.Length);
		cryptoStream.Close();
		byte[] result = memoryStream.ToArray();
		memoryStream.Close();
		return result;
	}

	public string b(string A_0)
	{
		return Encoding.UTF8.GetString(b(Convert.FromBase64String(A_0)));
	}

	public byte[] b(byte[] A_0)
	{
		IList<byte> list = new List<byte>();
		MemoryStream memoryStream = new MemoryStream(A_0);
		CryptoStream cryptoStream = new CryptoStream(memoryStream, this.m_a.CreateDecryptor(), CryptoStreamMode.Read);
		for (int num = cryptoStream.ReadByte(); num >= 0; num = cryptoStream.ReadByte())
		{
			list.Add((byte)num);
		}
		cryptoStream.Close();
		memoryStream.Close();
		byte[] array = new byte[list.Count];
		list.CopyTo(array, 0);
		return array;
	}
}
